<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/20
 * Time: 14:24
 */
//创建一个进程
$process = new swoole_process(function(swoole_process $process){
    $process->exec('/usr/local/php/bin/php', [__DIR__.'/process2.php']);
}, false, false);
$pid = $process->start();
echo "PID: $pid\n";
//等待子进程结束
swoole_process::wait();
echo "子进程已退出\n";


//创建一个守护进程
$process = new swoole_process(function(swoole_process $process){
    $process->exec('/usr/local/php/bin/php', [__DIR__.'/process2.php']);
}, false, true);
$pid = $process->start();
echo "PID: $pid\n";
//等待子进程结束
swoole_process::wait();
echo "子进程已退出\n";



